<form action="vote.manage.php" id="form_del" name="form_del" method="post">
	<input type="hidden" name="action" id="action" />
    <table class="from_table2_one">
	  <thead>
	  <tr class="area_ajax_list_title">
	    <th class="pd-left" width="50"><tpl> $langVoteLSelect </tpl></th>	
	    
        <th width="500"><tpl> $langVoteLTopic </tpl></th>
   	      <th width="50"><tpl> $langVoteLType </tpl></th>
		  <th width="50"><tpl> $langVoteLEstate </tpl></th>
		  <th width="50"><tpl> $langCOperation </tpl></th>
      </tr>
	  </thead>
	  <tpl> if $vote_array[0].vote_id neq '' </tpl>
		  <tpl> section name=i loop=$vote_array </tpl>
	 <tr>
	   <td class="pd-left" width="50" align="left"><input name="vote_id[]" type="checkbox" value="<tpl> $vote_array[i].vote_id </tpl>"/></td>	
		
	   <td width="500" align="left"><tpl> $vote_array[i].vote_title </tpl></td>
		 <td width="50" align="left"><tpl> if $vote_array[i].vote_check eq '0' </tpl>
			  		<tpl> $langVoteLRadio </tpl>
			 <tpl> else if $vote_array[i].vote_check eq '1' </tpl>
					<tpl> $langVoteLManySelect </tpl>
			 <tpl> /if </tpl>
	   </td>
		 <td width="50" align="left">
			  	<tpl> if $vote_array[i].vote_close eq '0' </tpl>
			  		<tpl> $langCOpen </tpl>
				<tpl> else if $vote_array[i].vote_close eq '1' </tpl>
					<tpl> $langCClose </tpl>
				<tpl> /if </tpl>
	   </td>
		<td width="50" align="left"><a href="javascript:;" onclick="hideMessage();ajax_modi('<tpl> $vote_array[i].vote_id </tpl>');" title=" <tpl> $langCedit </tpl>" class="edit_a_pic">
		 </a>	   </td>
	</tr>
		  <tpl> /section </tpl>
    
		  <tpl> else  </tpl>
		  <tr>
			<td colspan="6"><tpl> $langVoteLNotContent </tpl></td>
		  </tr>
		<tpl> /if </tpl>
  </table>
  <div class="table-5-bottom">
  <div class="p-left">
				<span class="btn_left"><input name="selectall" type="button" id="selectall" class="btn_submit" value="<tpl> $langVoteLAllSelect </tpl>" /></span>
				<span class="btn_left"><input name="negative" type="button" id="negative" class="btn_submit" value="<tpl> $langVoteLContrarySelect </tpl>" /></span>
				<span class="btn_left"><input type="button" id="openbutton" class="btn_submit" name="openbutton" value="<tpl> $langVoteLOpen </tpl>" /></span>
				<span class="btn_left"><input type="button" id="closebutton" class="btn_submit" name="closebutton" value="<tpl> $langVoteLClose </tpl>" /></span>
				<span class="btn_left"><input type="button" id="delbutton" class="btn_submit" name="delbutton" value="<tpl> $langVoteLDelVote </tpl>" /></span>
		  </div>
				<div style="float:right; padding-right:20px">
				<tpl> $page_list </tpl>		
				</div>
  </div>
	</form>
<div id="question" style="display:none; cursor: default; padding:10px"> 
        <b style=" font-size:14px; margin-top:10px; line-height:50px; height:50px;padding-

top:10px; padding-bottom:10px"><tpl> $langVoteLConfirmDel </tpl></b> <br />
        <input type="button" id="yes" value="<tpl> $langCYes </tpl>"  style=" border:1px solid 

#CCCCCC;width:80px; margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/> 
        <input type="button" id="no" value="<tpl> $langCNo </tpl>"  style="border:1px solid #CCCCCC;width:80px; 

margin:5px; background-image:url(../templates/system_new/images/anniu.gif)"/>
		<input type="hidden" id="del_value" />
</div> 
<script>
$(document).ready(function() {	
	var question;
	$('#negative').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',!$(this).attr('checked'))
			})
		}
		);
		$('#selectall').click(
		function(){
			$('#form_del input[@type=checkbox]').each(function(){
				$(this).attr('checked',true)
			})
		}
	);
	//删除操作
	var options_del = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("vote.manage.php?action=ajax_list");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	question = $('#question')[0];
	$("#delbutton").click(function(){
		$('#action').val('del');
		$.blockUI(question, { width: '275px' });
	});
	
	$('#yes').click(function() {
			//$.blockUI("<h1>Remote call in progress...</h1>" );
			$.unblockUI();
			$('#form_del').ajaxSubmit(options_del);	
			return false;
		});
	$('#no').click($.unblockUI);
	
	//关闭操作
	var options_close = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("vote.manage.php?action=ajax_list");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	$("#closebutton").click(function(){
		$('#action').val('close');
		$('#form_del').ajaxSubmit(options_close);	
	});
	
	//开启操作
	var options_open = {
		beforeSubmit:  function(){showLoading(showText);},
		success:       function(msg){
						hideLoading();
						showMessage(msg.message,msg.type);
						if(msg.type == '1'){
							ShowDiv = "result_content";
							getPageContent("vote.manage.php?action=ajax_list");
						}
					},
		type:      'post',
		dataType:  'json'
	};
	$("#openbutton").click(function(){
		$('#action').val('open');
		$('#form_del').ajaxSubmit(options_open);	
	});
});	

//编辑
function ajax_modi(id){
	//载入页面
	ShowDiv = "result_content";
	getPageContent("vote.manage.php?action=modi&id="+id);
}
</script>